Skip to content

feat: added list models request#645

Merged
Pratham-Mishra04 merged 1 commit intomainfrom
10-17-feat_added_list_models_request
Oct 25, 2025
Merged

feat: added list models request#645
Pratham-Mishra04 merged 1 commit intomainfrom
10-17-feat_added_list_models_request

Conversation

@TejasGhatte
Copy link
Copy Markdown
Collaborator

@TejasGhatte TejasGhatte commented Oct 17, 2025

Summary

Add support for listing models from various providers via a new /v1/models endpoint, enabling applications to discover available models and their capabilities. Closes #532

Changes

  • Added a new ListModels method to the Provider interface
  • Implemented model listing for multiple providers (OpenAI, Anthropic, Azure, Bedrock, Cohere, Gemini, Groq, Mistral, Ollama, OpenRouter)
  • Created provider-specific model response types and conversion functions to standardized Bifrost format
  • Added a new HTTP endpoint at /v1/models that accepts a provider query parameter
  • Enhanced the Bifrost core to track available providers and expose them through the API
  • Added support for non-deployment endpoints in Azure provider

Type of change

  • Feature

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations

How to test

# List models from a provider
curl "http://localhost:8000/v1/models?provider=openai" \
  -H "Authorization: Bearer $BIFROST_API_KEY"

# Expected response format
{
  "data": [
    {
      "id": "gpt-4",
      "object": "model",
      "created": 1687882411,
      "owned_by": "openai"
    },
    ...
  ],
  "extra_fields": {
    "provider": "openai",
    "request_type": "list_models",
    "latency": 123
  }
}

# Core tests
go test ./core/...

Breaking changes

  • No

Related issues

Enhances model discovery capabilities for applications using Bifrost.

Security considerations

The endpoint requires the same authentication as other Bifrost endpoints and only exposes information about available models, not any sensitive data.

Checklist

  • I added/updated tests where appropriate
  • I verified builds succeed (Go)
  • I verified the API works with multiple providers

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add /v1/models API endpoint to list models

2 participants